<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'dashboard-form',
	'enableAjaxValidation'=>false,
//        'enableClientValidation' => true,
//        'clientOptions' => array(
//            'validateOnSubmit' => true,
//        ),
//        'htmlOptions' => array('enctype' => 'multipart/form-data')
)); ?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>
        
        <div class="row buttons" align="right">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
	</div>
        
	<?php echo $form->errorSummary($model); ?>
        
        <div class="row">
		<?php echo $form->labelEx($model,'name'); ?>
		<?php echo $form->textField($model,'name',array('size'=>60,'maxlength'=>225,
                    'onkeyup' => CHtml::ajax(
                            array(
                                'type' => 'POST',
                                'url' => $this->createUrl('generateAlias'),
                                'success' =>
                                'function(html) {
                                                    $("#Dashboard_alias").val(html)
                                                }'
                            )
                    ),
                    'ajax' => array(
                        'type' => 'POST',
                        'url' => $this->createUrl('generateAlias'),
                        'update' => '#Dashboard_alias',
                    ),
                    )); ?>
		<?php echo $form->error($model,'name'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'alias'); ?>
		<?php echo $form->textField($model,'alias',array('size'=>60,'maxlength'=>225)); ?>
		<?php echo $form->error($model,'alias'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'term_id'); ?>
		<?php echo $form->textField($model,'term_id',array('size'=>10,'maxlength'=>10)); ?>
		<?php echo $form->error($model,'term_id'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'action'); ?>
		<?php
                $this->widget('application.extensions.gui.tinymce.ETinyMce', array(
                    'name' => 'Dashboard[action]',
                    'value' => $model->action,
                    'editorTemplate' => 'full',
//                    'htmlOptions' => array('style' => 'width:50%'),
                ));
                ?>
		<?php echo $form->error($model,'action'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'weight'); ?>
		<?php echo $form->textField($model,'weight'); ?>
		<?php echo $form->error($model,'weight'); ?>
	</div>


        
        <?php if (!$model->isNewRecord): ?>    
        <input type="hidden" name="update_id" value="<?php echo $model->id; ?>"/>
        <?php endif; ?>  
               
	<div class="row buttons" align="right">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->